package com.lzy.product.constants;

import com.lzy.framework.tools.commons.BigDecimalUtil;
import com.lzy.product.common.util.IEnum;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * Description: 业务相关枚举基类 相关枚举后续在此扩展 Author: ellengou Version: 1.0 Create Date
 * Time: 2017/3/29 上午10:47. Update Date Time:
 *
 * @see 'http://lzyhll.com'
 */
public class BusinessType {


    /**
     * @Author:liyx
     * @Description:保险单价
     * @Date:2017/7/11 10:34
     */
    public static final Integer INSU_PRICE = 10;

    /**
     * Admin userId
     */
    public static final Long SYS_USER_ADMIN_ID = 1L;
    /**
     * 线路推荐条数
     */
    public static final Integer LINE_COUNT = 6;

    /**
     * redis前缀
     *
     * @author lc
     * @date Jul 10, 2017 9:50:33 AM
     */
    public static final class DistributePrefix {
        /**
         * 缓存露营地经纬度以及ID
         */
        public static final String GEO_CAMPSITE_KEY = "geo:campsite:key";
        /**
         * 缓存露营地经纬度以及ID
         */
        public static final String QUERY_CAMPSITE = "query:campsite";
        /**
         * 房车租赁并发锁:lock:car:schedule:skuCode+日期
         */
        public static final String LOCK_CAR_SCHEDULE = "lock:car:schedule";
        /**
         * 露营地并发锁:lock:campsite:schedule:skuCode+日期
         */
        public static final String LOCK_CAMPSITE_SCHEDULE = "lock:campsite:schedule";
    }

    /**
     * 线路搜索范围:单位KM
     */
    public static final BigDecimal LINE_RANGE = new BigDecimal(200);

    /**
     * 状态 注释：0代表否，1代表是 Description: Create by lc 2017年4月20日上午9:31:44
     */
    public static final class Status {
        public static final Integer ZERO = 0;
        public static final Integer ONE = 1;
    }

    /**
     * 档期状态
     */
    public enum ScheduleType {
        REPARI(1, "维修"), MAINTAIN(2, "保养"), USE(3, "自用"), ORDER(4, "订单"), RENT(5, "可租");
        private String desc;
        private Integer code;

        ScheduleType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 证件图片类型
     */
    public enum LienceImageType {
        BUSINESS(1, "营业执照图片"), REGISTRATION(2, "税务登记图片"), ORGANIZATION(3, "组织机构代码图片"), ID(4, "手持身份证图片"), DRIVER(5,
                "驾驶证图片"), OBVERSEID(6, "身份证正面图片"), BACKID(7, "身份证反面图片");
        private String desc;
        private Integer code;

        LienceImageType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 房车类型
     */
    public enum CarType {
        SALE(1, "房车销售"), SHARE(2, "房车租赁");
        private String desc;
        private Integer code;

        CarType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 房车图片类型
     */
    public enum CarImageType {
        SURFACE(1, "外观图"), DECORATE(2, "内饰图"), DETAIL(3, "细节图"), POLICYID(4, "保单图片"), DRIVINGID(5, "行驶证图片");
        private String desc;
        private Integer code;

        CarImageType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 品牌类型
     */
    public enum BrandType {
        CAR(0, "房车"), OUTDOOR(1, "户外");
        private String desc;
        private Integer code;

        BrandType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 商戶所处行业类型
     */
    public enum ShopType {
        OUT_DOOR(1000L, "户外装备"),
        RV_RENTAL(2000L, "房车租赁"),
        RV_SALE(3000L, "房车销售"),
        CAMPSITE(4000L, "营地服务"),
        AROUND(5000L, "周边项目"),
        //		CREATION(6000L,"创客商城"),
        INTEGRAL(7000L, "积分商城"),
        //		CREATIVE(8000L, "创意空间"),
        DAY_TOUR(9000L, "本地向导");
        private String desc;
        private Long code;

        ShopType(Long code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Long getCode() {
            return code;
        }

        public void setCode(Long code) {
            this.code = code;
        }


        public static String desc(Long code) {
            for (ShopType c : ShopType.values()) {
                Long cCode = c.getCode();
                if (cCode.intValue() == code.intValue()) {
                    return c.getDesc();
                }
            }
            return null;
        }

        /**
         * 已开启模块列表
         *
         * @return
         */
        public static List<ShopType> getModule() {
            List<ShopType> shops = new ArrayList<>();
            shops.add(ShopType.OUT_DOOR);
            shops.add(ShopType.INTEGRAL);
            return shops;
        }

        //商户类型编号列表
        public static List<String> shopTypeList() {
            List<String> list = new ArrayList<>();
            ShopType[] shopTypes = ShopType.values();
            for (ShopType shopType : shopTypes) {
                list.add(shopType.getCode().toString());
            }
            return list;
        }
    }

    /**
     * 平台业务类型枚举
     */
    public enum Business {
        FIRST(0, "系统首页"), OUT_DOOR(1, "户外装备"), RV_RENTAL(2, "房车租赁"), RV_SALE(3, "房车销售"), CAMPSITE(4, "营地服务"), AROUND(5,
                "周边项目"),
        //		CREATION(6, "创客商城"),
//		INTEGRAL(7, "积分商城"),
//		CREATIVE(8, "创意空间"),
        DAY_TOUR(9, "陪你玩");
        private String desc;
        private Integer code;

        Business(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static Business getBusiness(Integer code) {
            switch (code) {
                case 0:
                    return FIRST;
                case 1:
                    return OUT_DOOR;
                case 2:
                    return RV_RENTAL;
                case 3:
                    return RV_SALE;
                case 4:
                    return CAMPSITE;
                case 5:
                    return AROUND;
//			case 6:
//				return CREATION;
//			case 7:
//				return INTEGRAL;
//			case 8:
//				return CREATIVE;
                case 9:
                    return DAY_TOUR;
            }
            return OUT_DOOR;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 轮播类型 ：类型 1-轮播 2-广告
     */
    public enum CarouselType {
        CAROUSEL(1, "轮播"), ADVERTISEMENT(2, "广告");
        private String desc;
        private Integer code;

        CarouselType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 用户附属信息用户类型 ： 1-向导 2-商城创客
     */
    public enum UserSubType {
        GUIDE(1, "向导"), MAKER_MALL_MAKER(3, "创客商城创客"), MAKER_SPACE_MAKER(4, "创意空间创客");
        private Integer code;
        private String desc;

        UserSubType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 认证信息数据类型 ： 1-商户 2-后台用户 3-会员
     */
    public enum LicenseSourceType {
        SHOP(1, "商户"), USER(2, "用户"), MEMBER(3, "会员"), STORE(4, "店铺");
        private Integer code;
        private String desc;

        LicenseSourceType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * '类型（1-龙珠，2-龙币，3-房车券，4-特价）'
     */
    public enum PromotionType {
        DRAGON(1, "龙珠"), COIN(2, "龙币"), RVTICKET(3, "房车券"), DISCOUNT(4, "特价"), GRAB_COUPONS(5, "抢券"), ALL_PLAY(6, "都在玩");

        private Integer code;
        private String desc;

        PromotionType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 商戶认证类型
     */
    public enum AuthType {
        BASE_AUTH(1000L, "龙之游认证");
        private String desc;
        private Long code;

        AuthType(Long code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Long getCode() {
            return code;
        }

        public void setCode(Long code) {
            this.code = code;
        }
    }

    /**
     * 照片类型
     */
    public enum ImageType {
        SHOP_BANNER(1, "店铺门头"), ITEM(2, "商品照片"), ITEM_BANNER(3, "商品列表图"), EVAL(4, "评论图片");
        private String desc;
        private Integer code;

        ImageType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 图片位置
     */
    public enum ImagePosition {
        FRONT(1, "前"), BACK(2, "后"), LEFT(3, "左"), RIGHT(4, "右"), OTHER(5, "其他");
        private String desc;
        private Integer code;

        ImagePosition(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 商品图文详情类型 用于处理商品图文详情
     */
    public enum ImageTextType {
        WORD(1, "文字"), IMAGE(2, "图片"), VIDEO(3, "视频"), VOICE(4, "语音"), GIF(5, "GIF"), URL(6, "url"), TITLE(7,
                "标题"), LINK(8, "外部链接");
        private String desc;
        private Integer code;

        ImageTextType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 主流角色类型
     */
    public enum RoleType {
        SUPER_ADMIN(1L, "超级管理员"), SALESMAN(3L, "业务员");

        private String desc;
        private Long code;

        RoleType(Long code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Long getCode() {
            return code;
        }

        public void setCode(Long code) {
            this.code = code;
        }
    }

    /**
     * 用户角色类型
     */
    public enum SysRoleType {
        SYS(0, "系统"), PLATFORM(1, "平台"), OPERATION(2, "运营"), SHOP(3, "商家"), FACILITATOR(4, "服务商"), AGENTS(5, "代理商");
        private String desc;
        private Integer code;

        SysRoleType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 用户身份
     */
    public enum UserIdentity {
        FACILITATOR(1L, "服务商"), AGENTS(2L, "代理商");
        private String desc;
        private Long code;

        UserIdentity(Long code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Long getCode() {
            return code;
        }

        public void setCode(Long code) {
            this.code = code;
        }
    }

    /**
     * 会员账户余额类型 用于处理订单支付手段
     */
    public enum AccountBalanceType {
        INTEGRATION(1, "龙珠"), CURRENCY(2, "龙币");
        private String desc;
        private Integer code;

        AccountBalanceType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 商户数据来源
     */
    public enum ShopSourceType {
        PLATFORM(1, "运营后台"), SPONTANEOUS(2, "商家入驻");
        private String desc;
        private Integer code;

        ShopSourceType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 收藏纬度 1-商品2-商户3-线路
     */
    public enum FavoriteType {
        GOODS(1, "收藏商品"), SHOP(2, "收藏商户"), LINE(3, "收藏线路");
        private String desc;
        private Integer code;

        FavoriteType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 房车销售房车推荐
     */
    public enum RecommendType {
        Preferential(1, "限时特惠"), APAS(4, "特价推荐"), Recommend(3, "房车推荐");
        private String desc;
        private Integer code;

        RecommendType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 审核
     *
     * @author lc Jun 15, 2017 9:58:20 AM
     */
    public enum VerifyStatusEnum {

        VERIFY(0, "审核中"), YESVERIFY(1, "审核通过"), NOVERIFY(2, "审核未通过");

        private VerifyStatusEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取v
         *
         * @return
         */
        public static String getV(Integer k) {
            for (VerifyStatusEnum c : VerifyStatusEnum.values()) {
                if (c.getK().equals(k)) {
                    return c.getV();
                }
            }
            return "";
        }

    }

    /**
     * 类型 false：下架 true：上架
     *
     * @author swt
     */
    public enum ItemSkuTypeEnum {
        PULL(false, "下架"), PUT(true, "上架");

        private ItemSkuTypeEnum(Boolean k, String v) {
            this.k = k;
            this.v = v;
        }

        private Boolean k;
        private String v;

        public Boolean getK() {
            return k;
        }

        public void setK(Boolean k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        public static String getV(Boolean k) {
            for (ShelfEnum c : ShelfEnum.values()) {
                if (c.getK().equals(k)) {
                    return c.getV();
                }
            }
            return "";
        }
    }

    /**
     * 类型 false：下架 true：上架
     *
     * @author swt
     */
    public enum LicenceTypeEnum {
        PULL(false, "下架"), PUT(true, "上架");

        private LicenceTypeEnum(Boolean k, String v) {
            this.k = k;
            this.v = v;
        }

        private Boolean k;
        private String v;

        public Boolean getK() {
            return k;
        }

        public void setK(Boolean k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        public static String getV(Boolean k) {
            for (ShelfEnum c : ShelfEnum.values()) {
                if (c.getK().equals(k)) {
                    return c.getV();
                }
            }
            return "";
        }
    }

    /**
     * 上架、下架
     *
     * @author lc Jun 15, 2017 9:58:20 AM
     */
    public enum ShelfEnum {
        PULL(0, "下架"), PUT(1, "上架");

        private ShelfEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取v
         *
         * @return
         */
        public static String getV(Integer k) {
            for (ShelfEnum c : ShelfEnum.values()) {
                if (c.getK().equals(k)) {
                    return c.getV();
                }
            }
            return "";
        }
    }

    /**
     * 推荐、不推荐
     *
     * @author lc Jun 15, 2017 9:58:20 AM
     */
    public enum RecommendEnum {
        NO(0, "不推荐"), YES(1, "推荐");

        private RecommendEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取v
         *
         * @return
         */
        public static String getV(Integer k) {
            for (RecommendEnum c : RecommendEnum.values()) {
                if (c.getK().equals(k)) {
                    return c.getV();
                }
            }
            return "";
        }

        /**
         * 获取list
         */
        public static List<InnerRefund> getEnumList() {
            List<InnerRefund> list = new ArrayList<InnerRefund>();
            for (RecommendEnum c : RecommendEnum.values()) {
                // TODO 单例
                list.add(c.new InnerRefund(c.getK(), c.getV()));

            }
            return list;
        }

        private class InnerRefund {
            // 值
            private Integer k;
            // 描述
            private String v;

            public Integer getK() {
                return k;
            }

            public void setK(Integer k) {
                this.k = k;
            }

            public String getV() {
                return v;
            }

            public void setV(String v) {
                this.v = v;
            }

            private InnerRefund(Integer k, String v) {
                super();
                this.k = k;
                this.v = v;
            }

        }
    }

    /**
     * 线路类型
     *
     * @author lc Jun 15, 2017 9:58:20 AM
     */
    public enum LineTypeEnum {
        PLATFORM(0, "平台"), USER(1, "用户");

        private LineTypeEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取v
         *
         * @return
         */
        public static String getV(Integer k) {
            for (LineTypeEnum c : LineTypeEnum.values()) {
                if (c.getK().equals(k)) {
                    return c.getV();
                }
            }
            return "";
        }
    }

    /**
     * 城市热度类型
     *
     * @author lc Jun 15, 2017 9:58:20 AM
     */
    public enum CityTopEnum {
        COOL(0, "冷门"), HOT(1, "热门");

        private CityTopEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取v
         *
         * @return
         */
        public static String getV(Integer k) {
            for (CityTopEnum c : CityTopEnum.values()) {
                if (c.getK().equals(k)) {
                    return c.getV();
                }
            }
            return "";
        }
    }

    /**
     * 地区等级划分
     */
    public enum LevelEnum {
        PRO(1, "省份"), CITY(2, "城市"), DIS(3, "区县");

        private LevelEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取v
         *
         * @return
         */
        public static String getV(Integer k) {
            for (CityTopEnum c : CityTopEnum.values()) {
                if (c.getK().equals(k)) {
                    return c.getV();
                }
            }
            return "";
        }
    }

    /**
     * 陪你玩向导城市乡村划分
     */
    public enum DivisionEnum {
        PRO(0, "省份"), CITY(1, "城市"), DIS(1, "乡村");

        private DivisionEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取v
         *
         * @return
         */
        public static String getV(Integer k) {
            for (CityTopEnum c : CityTopEnum.values()) {
                if (c.getK().equals(k)) {
                    return c.getV();
                }
            }
            return "";
        }
    }

    /**
     * 城市热度类型
     *
     * @author lc Jun 15, 2017 9:58:20 AM
     */
    public enum UseEnum {
        NO(0, "未使用"), YES(1, "已使用"),;

        private UseEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取v
         *
         * @return
         */
        public static String getV(Integer k) {
            for (UseEnum c : UseEnum.values()) {
                if (c.getK().equals(k)) {
                    return c.getV();
                }
            }
            return "";
        }
    }

    /**
     * 商城活动类型枚举 类型：1-热门版块，2-单品推荐 ，3-活动推荐 ，5-特别推荐
     */
    public enum ActivityType {
        HOT(1, "热门版块"), SINGLE(2, "单品推荐"), ACTIVITIES(3, "活动推荐"), ESPECIALLY(5, "特别推荐"), PLAY(6, "玩什么推荐活动");
        private String desc;
        private Integer code;

        ActivityType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static ActivityType getActivityType(Integer code) {
            switch (code) {
                case 1:
                    return HOT;
                case 2:
                    return SINGLE;
                case 3:
                    return ACTIVITIES;
                case 5:
                    return ESPECIALLY;
                case 6:
                    return PLAY;
            }
            return HOT;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 卡券状态
     */
    public enum CouponType {
        UNBIND(1, "未绑定"), BIND(2, "已绑定"), USERD(3, "已使用"), EXPIRED(4, "已过期"), EXPIRING(5, "即将过期");
        private String desc;
        private Integer code;

        CouponType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 向导认证状态
     */
    public enum Trip {
        TripStatus(1L, "金牌向导"), AGENTS(2L, "实名制认证");
        private String desc;
        private Long code;

        Trip(Long code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Long getCode() {
            return code;
        }

        public void setCode(Long code) {
            this.code = code;
        }

        public static String[] getDescArray() {
            String[] strArr = new String[2];
            Trip[] arr = Trip.values();
            for (int i = 0; i < arr.length; i++) {
                strArr[i] = arr[i].getDesc();
            }
            return strArr;
        }
    }

    /**
     * 启用禁用状态
     */
    public enum StatusEnum {
        ENABLED(0, "启用"), DISABLED(1, "禁用");
        private String desc;
        private Integer code;

        StatusEnum(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 启用禁用状态
     */
    public enum OverdueStatusEnum {
        ENABLED(0, "进行中"), DISABLED(1, "已失效");
        private String desc;
        private Integer code;

        OverdueStatusEnum(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 上架、下架、下架待优化
     *
     * @author swt
     */
    public enum MarketAbleEnum {
        PUT(0, "上架"), PULL(1, "下架"), REPAIR(2, "下架待优化");

        private MarketAbleEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取v
         *
         * @return
         */
        public static String getV(Integer k) {
            for (ShelfEnum c : ShelfEnum.values()) {
                if (c.getK().equals(k)) {
                    return c.getV();
                }
            }
            return "";
        }
    }

    /**
     * 类型 1：下架 2：上架 3：审核未通过 4：审核通过
     *
     * @author swt
     */
    public enum PlayRecordTypeEnum {
        PULL(1, "下架"), PUT(2, "上架"), NOVERIFY(3, "审核未通过"), YESVERIFY(4, "审核通过");

        private PlayRecordTypeEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        public static String getV(Integer k) {
            for (ShelfEnum c : ShelfEnum.values()) {
                if (c.getK().equals(k)) {
                    return c.getV();
                }
            }
            return "";
        }
    }

    /**
     * 营地是否热门：1-热门营地。2-非热门营地
     */

    public enum CampsitePopularEnum {
        IsPopular(1, "热门营地"), NoPopular(2, "非热门营地");
        private String desc;
        private Integer code;

        CampsitePopularEnum(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }


    /**
     * 房车参数适用范围
     */
    public enum CarConfigSourceType {
        RENT(1, "租赁"), SALE(0, "销售");
        private String desc;
        private Integer code;

        CarConfigSourceType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 短信发送是否成功
     */
    public enum SendStatus {
        UNSENT(0, "未发送"), SEND(1, "发送");
        private String desc;
        private Integer code;

        SendStatus(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 渠道（1-系统分配，2-二维码）
     */
    public enum ChannelStatus {
        SYSTEM_ALLOCATION(1, "系统分配"), QR_CODE(2, "二维码");
        private String desc;
        private Integer code;

        ChannelStatus(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }


    /**
     * 卡券类型（1-房车券，2-房车代金券）
     * table 'common_source_coupon'  comment
     */
    public enum CamperSourceCouponType {
        CAMPER_TICKET(1, "房车券"), CAMPER_CASH_TICKET(2, "房车代金券");
        private String desc;
        private Integer code;

        CamperSourceCouponType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * profit使用 服务费方案-数据字典前缀
     */
    public static final String PLATFORM_FEE_SCHEME = "dic:platform_fee_scheme";
    /**
     * 无分类的默认值
     */
    public static final Long NO_CATEGORY = 0L;
    /**
     * 分利平台服务费模板
     */
    public static final String SERVICE_FEE = "service_fee:";
    /**
     * 分隔符
     */
    public static final String SEPARATOR = ":";
    /**
     * 分类
     */
    public static final String CATEGORY = "category:";
    /**
     * 分类ID
     */
    public static final String CATEGORY_ID = "category_id:";

    /**
     * 服务费方案
     */
    public static final class ServiceFeeScheme {
        // 数量方案
        public static final Integer AMOUNT_SCHEME = 1;
        // 总价方案
        public static final Integer PRICES_SCHEME = 2;
    }

    public static final class ReportType {
        /**
         * 财务报表
         */
        public static final int FINANCE_REPORT = 1;
        /**
         * 订单报表
         */
        public static final int ORDER_REPORT = 2;
    }

    /**
     * 向导线路推荐状态
     */
    public enum GuideRecommendStatus {
        NO(1, "未推荐"), YES(2, "已推荐");
        private String desc;
        private Integer code;

        GuideRecommendStatus(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 营地设施
     */
    public enum CampsiteProject {
        project(1, "基础设施"), service(2, "服务客群");
        private String desc;
        private Integer code;

        CampsiteProject(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 营业状态
     */
    public enum OperatingStatus {
        on(1, "营业中"), down(2, "歇业中");
        private String desc;
        private Integer code;

        OperatingStatus(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }


    /**
     * 营业状态
     */
    public enum DragonStatus {
        send(1, "活动赠送"), member(2, "会员注册"), product(3, "产品套餐");
        private String desc;
        private Integer code;

        DragonStatus(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /*出发时间筛选*/
                        /*
                        *   "00:00 - 06:00"  ： "^([0-0][0-5]:[0-5][0-9]|[0-0][0-6]:[0-0][0-0])$"
                        *   "06:00 - 12:00"  ： " ^([0-0][6-9]:[0-5][0-9]|[1-1][0-1]:[0-5][0-9]|[1-1][0-2]:[0-0][0-0])$"
                        *  "12:00 - 18:00"  ： " ^([1-1][2-7]:[0-5][0-9]|[1-1][2-8]:[0-0][0-0])$"
                        *  "18:00 - 24:00"  ： " ^([1-1][8-9]:[0-5][0-9]|[2-2][0-3]:[0-5][0-9]|[2-2][0-4]:[0-0][0-0])$"
                        *
                        * */
    public enum TrainStartTimeRegularMatch {
        START_TIME_SIX("SIX", "^([0-0][0-5]:[0-5][0-9]|[0-0][0-6]:[0-0][0-0])$"),//"00:00 - 06:00"
        START_TIME_TWELVE("TWELVE", "^([0-0][6-9]:[0-5][0-9]|[1-1][0-1]:[0-5][0-9]|[1-1][0-2]:[0-0][0-0])$"),// "06:00 - 12:00"
        START_TIME_EIGHTEEN("EIGHTEEN", "^([1-1][2-7]:[0-5][0-9]|[1-1][2-8]:[0-0][0-0])$"),// "06:00 - 12:00"
        START_TIME_TWENTY_FOUR("TWENTY_FOUR", "^([1-1][8-9]:[0-5][0-9]|[2-2][0-3]:[0-5][0-9]|[2-2][0-4]:[0-0][0-0])$");// "18:00 - 24:00"

        private String code;
        private String codeMatch;

        TrainStartTimeRegularMatch(String code, String codeMatch) {
            this.code = code;
            this.codeMatch = codeMatch;
        }

        public String getCodeMatch() {
            return codeMatch;
        }

        public void setCodeMatch(String codeMatch) {
            this.codeMatch = codeMatch;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }
    }

    /**
     * 票类型 :  (1-成人票，2-儿童票，3-婴儿，4-残军票，5-学生票)
     */
    public enum TicketType {
        ADULT_TICKET(1, "成人票"), CHILDREN_TICKET(2, "儿童票"), BABY_TICKET(3, "婴儿"), REMNANT_SOLDIER(4, "残军票"), STUDENT_TICKET(5,
                "学生票");
        private String desc;
        private Integer code;

        TicketType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 证件类型 : (1-二代身份证，2-一代身份证，3-港澳通行证，4-护照，5-台湾通行证，9-其他)
     */
    public enum CertificateType {
        TWO_GENERATION_CARD(1, "二代身份证"), ONE_GENERATION_CARD(2, "一代身份证"), HONG_KONG_MACAO(3, "港澳通行证"), PASSPORT(4, "护照"), TAIWAN_PASS(5,
                "台湾通行证");
        private String desc;
        private Integer code;

        CertificateType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 房车卡券种类 : 1-全日房车券 , 2-工作日房车券 ， 3-节假日房车券， 4-房车代金券
     */
    public enum CarCouponType {
        ALL_DAY_COUPON(1, "全日房车券"), WORK_DAY_COUPON(2, "工作日房车券"), HOLIDAY_DAY_COUPON(3, "节假日房车券"), AGENT_MONEY_COUPON(4, "房车代金券");

        private String desc;
        private Integer code;

        CarCouponType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 小程序业务类型
     */
    public enum AppletBusiness {
        FIRST(0, "小程序首页"), LINE(1, "推荐线路"), ACTIVITY(2, "活动推广"), ITEM(3, "旅行装备");
        private String desc;
        private Integer code;

        AppletBusiness(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static AppletBusiness getBusiness(Integer code) {
            switch (code) {
                case 0:
                    return FIRST;
                case 1:
                    return LINE;
                case 2:
                    return ACTIVITY;
                case 3:
                    return ITEM;
            }
            return FIRST;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 小程序协议类型
     */
    public enum AppletAgreementBusiness {
        LEASE(1, "房车租赁协议"), REGISTER(2, "小程序注册协议");
        private String desc;
        private Integer code;

        AppletAgreementBusiness(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static AppletAgreementBusiness getBusiness(Integer code) {
            switch (code) {
                case 1:
                    return LEASE;
                case 2:
                    return REGISTER;
            }
            return LEASE;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 产品包含项类型
     */
    public enum ProType {
        FIXED(0, "固定项"), SINGLE(1, "单选项");

        private String desc;
        private Integer code;

        ProType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 状态（1-待支付，2-购买成功，3-已关闭）
     */
    public enum OrderType implements IEnum {
        PAYING(1, "待支付"), PAYSUCCESS(2, "购买成功"), CLOSED(3, "已关闭");

        private String desc;
        private Integer code;

        OrderType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 支付方式（0-线上，1-线下）
     */
    public enum PayWay {
        onLine(0, "线上"), offLine(1, "线下");

        private String desc;
        private Integer code;

        PayWay(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    public enum ProjectType implements IEnum {
        DRAGON(1, "龙珠"),
        STOCK_RIGHTS(2, "股权"),
        CAR_COUPON(3, "房车券"),
        MOTOR_COUPON(4, "汽摩券"),
        COUPON_CAR_COUPON(5, "房车券"),
        COUPON_MOTOR_COUPON(6, "汽摩券");
        private String desc;
        private Integer code;

        ProjectType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        /**
         * 根据code获取desc
         *
         * @return
         */
        public static String getDesc(Integer k) {
            for (ProjectType c : ProjectType.values()) {
                if (c.getCode().equals(k)) {
                    return c.getDesc();
                }
            }
            return null;
        }
    }

    public enum ProjectPriceType {
        FIVE_ONE(5, 1),
        FIVE_THREE(5, 2),
        FIVE_FIVE(5, 3),
        SIX_ONE(6, 1),
        SIX_TWO(6, 2),
        SIX_THREE(6, 3),
        SIX_FOUR(6, 4),
        SIX_FIVE(6, 5),
        SIX_SIX(6, 6),
        SIX_SEVEN(6, 7),
        SIX_EIGHT(6, 8),
        SIX_NIGHT(6, 9),
        SIX_TEN(6, 10);

        private Integer desc;
        private Integer code;

        ProjectPriceType(Integer code, Integer desc) {
            this.code = code;
            this.desc = desc;
        }

        public Integer getDesc() {
            return desc;
        }

        public void setDesc(Integer desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        /**
         * 根据code获取desc列表
         *
         * @param code
         * @return
         */
        public static List<Integer> projectPriceList(Integer code) {
            List<Integer> list = new ArrayList<>();
            for (ProjectPriceType c : ProjectPriceType.values()) {
                Integer cCode = c.getCode();
                if (cCode.intValue() == code.intValue()) {
                    list.add(c.getDesc());
                }
            }
            return list;
        }

        /**
         * 获取去重后的code列表
         *
         * @return
         */
        public static List<Integer> projectList() {
            List<Integer> list = new ArrayList<>();
            for (ProjectPriceType c : ProjectPriceType.values()) {
                if (!list.contains(c.getCode())) {
                    list.add(c.getCode());
                }
            }
            return list;
        }
    }

    public enum PriceType {
        ONE_HUNDRED(1, new BigDecimal(80.00).intValue()),
        TWO_HUNDRED(2, new BigDecimal(100.00).intValue()),
        THREE_HUNDRED(3, new BigDecimal(120.00).intValue()),
        FOUR_HUNDRED(4, new BigDecimal(160.00).intValue()),
        FIVE_HUNDRED(5, new BigDecimal(188.00).intValue()),
        SIX_HUNDRED(6, new BigDecimal(258.00).intValue()),
        SEVEN_HUNDRED(7, new BigDecimal(788.00).intValue()),
        EIGHT_HUNDRED(8, new BigDecimal(1688.00).intValue()),
        NIGHT_HUNDRED(9, new BigDecimal(268.00).intValue()),
        TEN_HUNDRED(10, new BigDecimal(328.00).intValue());

        private Integer code;
        private Integer desc;

        PriceType(Integer code, Integer desc) {
            this.code = code;
            this.desc = desc;
        }

        public Integer getDesc() {
            return desc;
        }

        public void setDesc(Integer desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        /**
         * 根据code获取desc
         *
         * @return
         */
        public static Integer getPrice(Integer k) {
            for (PriceType c : PriceType.values()) {
                if (c.getCode().equals(k)) {
                    return c.getDesc();
                }
            }
            return null;
        }
    }

    public enum PresentType implements IEnum {
        DRAGON(1, "龙珠"),
        CURRENCY(2, "龙币"),
        CAR_COUPON(3, "房车券");

        private String desc;
        private Integer code;

        PresentType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    public enum ProductType implements IEnum {
        MEAL(1, "套餐"),
        COUPON(2, "卡券");

        private String desc;
        private Integer code;

        ProductType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    public enum ProjectBusiType implements IEnum {
        MEAL(1, "套餐类"),
        COUPON(2, "卡券类");

        private String desc;
        private Integer code;

        ProjectBusiType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    /**
     * 队列名称
     */
    public static final class QueueKey {
        public static final String ZSET_LOCK = "zsetlock";
        /**
         * 如果是zset集合，请加上改前缀
         */
        public static final String ZSET = "zset:";
        /**
         * 订单支付时间
         */
        public static final String QUEUE_ORDER_PAY_TIME = "queue:order:paytime";
        /**
         * 产品订单超时
         */
        public static final String QUEUE_PRODUCT_ORDER_PAY_TIME = "queue:product:order:paytime";
    }

    /**
     * 订单缓存名称
     */
    public static final class Cache {
        /**
         * 订单分利记录缓存
         */
        public static final String QUEUE_PRODUCT_PROFIT_RECORD = "queue:product:profit:record";
    }

    /**
     * 分利处理
     */
    public enum ProfitErrorStatus implements IEnum {
        NO_DEAL(0, "待处理"),
        DEAL_SUCCESS(1, "处理成功"),
        DEAL_FAILED(2, "处理失败");

        private Integer code;
        private String desc;

        ProfitErrorStatus(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        @Override
        public Integer getCode() {
            return code;
        }

        @Override
        public String getDesc() {
            return desc;
        }
    }

    /**
     * 缓存标识，默认保存1年（30天）
     */
    public static final int EXPIRED_SECOND = 12 * 30 * 24 * 60 * 60;

    public enum CouponMode implements IEnum {

        COLLAR_TIME(1, "领用时间计时"),
        GENERATION_TIME(2, "生成时间计时");

        private String desc;
        private Integer code;

        CouponMode(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        @Override
        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        @Override
        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    public enum OrderProductType implements IEnum {

        PRODUCT(1, "套餐类"),
        COUPONS(2, "卡券宝"),
        AGENTPROTOCOL(3, "代理商协议"),
        AGENTPRODUCT(4, "代理商产品");

        private String desc;
        private Integer code;

        OrderProductType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        @Override
        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        @Override
        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    public enum MemberCouponsType implements IEnum {

        PROFIT(1, "套餐补贴"),
        COMMISSION(2, "佣金"),
        COUPONS(3, "卖券收益"),
        AGENTPROFIT(4,"代理商收益");

        private Integer code;
        private String desc;

        MemberCouponsType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        @Override
        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        @Override
        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    public enum CouponProfitStatus implements IEnum {

        NO_USE(0, "未使用"),
        LIMITED(1, "已限制"),
        LIMITED_FAILED(2, "限制错误"),
        AVAILED(3, "可提现"),
        AVAILED_FAILED(4, "可提现错误");

        private String desc;
        private Integer code;

        CouponProfitStatus(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        @Override
        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        @Override
        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }

    // 状态（1-待支付，2-购买成功（审核中），3-已关闭，4-返现中，5-已到期）
    public enum CouponOrderType implements IEnum {
        PAYING(1, "待支付"),
        PAYING_SUCCESS(2, "购买成功"),
        CLOSED(3, "已关闭"),
        BACKING(4, "返现中"),
        EXPIRE(5, "已到期");
        private String desc;
        private Integer code;

        CouponOrderType(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        /**
         * 根据code获取desc
         *
         * @return
         */
        public static String getDesc(Integer k) {
            for (CouponOrderType c : CouponOrderType.values()) {
                if (c.getCode().equals(k)) {
                    return c.getDesc();
                }
            }
            return null;
        }
    }
}
